﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace postSale.forms
{
    public partial class warrantyCardPrintOptions : application.forms.dialogWithOption
    {
        public warrantyCardPrintOptions()
        {
            InitializeComponent();
            optionsCb.Items.Clear();
            optionsCb.Items.Add(new common.myTypes.ComboBoxItem("Phiếu bảo hành", FormTypes.WarrantyCard.ToString()));
            optionsCb.Items.Add(new common.myTypes.ComboBoxItem("Bảng kê thiết bị", FormTypes.ItemList.ToString()));
            optionsCb.SelectedIndex = 0;
        }

        public enum FormTypes { WarrantyCard, ItemList}
        public class Options
        {
            public FormTypes Type = FormTypes.WarrantyCard;
        }
        public FormTypes myOption
        {
            get
            {
                switch (optionsCb.SelectedIndex)
                {
                    case 0: return FormTypes.WarrantyCard;
                }
                return FormTypes.ItemList; 
            }
            set
            {
                switch (value)
                {
                    case FormTypes.WarrantyCard: optionsCb.SelectedIndex = 0; break;
                    default: optionsCb.SelectedIndex = 1; break;
                }
            }
        }
    }
}
